home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Makefile.in < prev    next >
Encoding:
Makefile  |  1994-10-10  |  8.1 KB  |  281 lines  |  [TEXT/R*ch]

  1. ########################################################################
  2. # Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
  3. # Amsterdam, The Netherlands.
  4. #                         All Rights Reserved
  5. # Permission to use, copy, modify, and distribute this software and its 
  6. # documentation for any purpose and without fee is hereby granted, 
  7. # provided that the above copyright notice appear in all copies and that
  8. # both that copyright notice and this permission notice appear in 
  9. # supporting documentation, and that the names of Stichting Mathematisch
  10. # Centrum or CWI not be used in advertising or publicity pertaining to
  11. # distribution of the software without specific, written prior permission.
  12. # STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
  13. # THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  14. # FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
  15. # FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  16. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  17. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
  18. # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  19. ########################################################################
  20.  
  21. # Toplevel Makefile for Python
  22. # Note -- if recursive makes fail, try adding MAKE=make
  23.  
  24. # Substitutions by configure
  25. srcdir=        @srcdir@
  26. VPATH=        @srcdir@
  27. INSTALL=    @INSTALL@
  28. RANLIB=        @RANLIB@
  29.  
  30. # Machine-dependent subdirectories
  31. MACHDEP=    @MACHDEP@
  32.  
  33. # Install prefixes are treated specially by the configure script:
  34. # it only changes these lines if it has received a --prefix=... or
  35. # --exec-prefix=... command line option.  Note that $(prefix) is
  36. # also used when compiling config.c in Modules to set the default
  37. # module search path, so if you change it later be sure to change it
  38. # there too and rebuild.
  39.  
  40. # Install prefix for architecture-independent files
  41. prefix=        /usr/local
  42.  
  43. # Install prefix for architecture-dependent files
  44. exec_prefix=    $(prefix)
  45.  
  46. # Symbols used for using shared libraries
  47. SO=        @SO@
  48. LDSHARED=    @LDSHARED@
  49. CCSHARED=    @CCSHARED@
  50. LINKFORSHARED=    @LINKFORSHARED@
  51. DESTSHARED=    $(prefix)/lib/python/$(MACHDEP)
  52.  
  53. # Programs
  54. SHELL=        /bin/sh
  55.  
  56. # --with-PACKAGE options for configure script
  57. # e.g. --with-readline --with-svr5 --with-solaris --with-thread
  58. # (see README for an explanation)
  59. WITH=        
  60.  
  61. # Compiler options passed to subordinate makes
  62. OPT=        @OPT@
  63.  
  64. # Subdirectories where to run make recursively
  65. SUBDIRS=    Parser Objects Python Modules
  66.  
  67. # Other subdirectories
  68. SUBDIRSTOO=    Include Lib Doc Misc Demo readline Grammar
  69.  
  70. # Files and directories to be distributed
  71. CONFIGFILES=    configure configure.in acconfig.h config.h.in Makefile.in
  72. DISTFILES=    README ChangeLog $(CONFIGFILES)
  73. DISTDIRS=    $(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
  74. DIST=        $(DISTFILES) $(DISTDIRS)
  75.  
  76. # Default target
  77. all:        python
  78.  
  79. # Build the interpreter
  80. python:        Makefiles
  81.         for i in $(SUBDIRS); do \
  82.             (echo $$i; cd $$i; $(MAKE) OPT="$(OPT)" all); \
  83.         done
  84.  
  85. # Test the interpreter (twice, once without .pyc files, once with)
  86. TESTPATH=    $(srcdir)/Lib:$(srcdir)/Lib/test
  87. test:        python
  88.         -rm -f $(srcdir)/Lib/test/*.pyc
  89.         PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
  90.         PYTHONPATH=$(TESTPATH) ./python -c 'import autotest'
  91.  
  92. # Install the interpreter
  93. install:    python
  94.         $(INSTALL) python $(exec_prefix)/bin/python
  95.         @echo If this is your first time, consider make libinstall...
  96.  
  97. # Install the library.
  98. # If your system does not support "cp -r", try "copy -r" or perhaps
  99. # something like find Lib -print | cpio -pacvdmu $(LIBDEST)
  100. LIBDEST=    $(prefix)/lib/python
  101. libinstall:
  102.         -if test ! -d $(LIBDEST); \
  103.         then mkdir $(LIBDEST); \
  104.         fi
  105.         cp -r $(srcdir)/Lib/* $(LIBDEST)
  106.         PYTHONPATH=$(LIBDEST) \
  107.             ./python $(LIBDEST)/compileall.py $(LIBDEST)
  108.  
  109. # install the manual page
  110. maninstall:
  111.         $(INSTALL) $(srcdir)/Misc/python.man \
  112.             $(prefix)/man/man1/python.1
  113.  
  114. # install the include files
  115. INCLUDEPY=    $(prefix)/include/Py
  116. inclinstall:
  117.         -if test ! -d $(INCLUDEPY); \
  118.         then mkdir $(INCLUDEPY); \
  119.         fi
  120.         cp $(srcdir)/Include/*.h $(INCLUDEPY)
  121.  
  122. # install the lib*.a files and miscellaneous stuff needed by extensions
  123. LIBP=        $(exec_prefix)/lib/python
  124. LIBPL=        $(LIBP)/lib
  125. libainstall:    all
  126.         -if test ! -d $(LIBP); \
  127.         then mkdir $(LIBP); \
  128.         fi
  129.         -if test ! -d $(LIBPL); \
  130.         then mkdir $(LIBPL); \
  131.         fi
  132.         for i in $(SUBDIRS); do \
  133.             echo $$i; $(INSTALL) $$i/lib$$i.a $(LIBPL)/lib$$i.a; \
  134.             $(RANLIB) $(LIBPL)/lib$$i.a; \
  135.         done
  136.         $(INSTALL) Modules/config.c $(LIBPL)/config.c
  137.         $(INSTALL) $(srcdir)/Modules/config.c.in $(LIBPL)/config.c.in
  138.         $(INSTALL) Modules/Makefile $(LIBPL)/Makefile
  139.         $(INSTALL) Modules/Setup $(LIBPL)/Setup
  140.         $(INSTALL) $(srcdir)/Modules/makesetup $(LIBPL)/makesetup
  141.         $(INSTALL) config.h $(LIBPL)/config.h
  142.         $(INSTALL) $(srcdir)/Python/frozenmain.c $(LIBPL)/frozenmain.c
  143.  
  144. # install the dynamically loadable modules
  145. sharedinstall:
  146.         cd Modules; $(MAKE) \
  147.             OPT="$(OPT)" \
  148.             SO="$(SO)" \
  149.             LDSHARED="$(LDSHARED)" \
  150.             CCSHARED="$(CCSHARED)" \
  151.             LINKFORSHARED="$(LINKFORSHARED)" \
  152.             DESTSHARED="$(DESTSHARED)" \
  153.             sharedinstall
  154.  
  155. # Build the sub-Makefiles
  156. Makefiles:    config.status
  157.         (cd Modules; $(MAKE) -f Makefile.pre Makefile)
  158.         for i in . $(SUBDIRS); do \
  159.             (echo $$i; cd $$i; $(MAKE) Makefile); \
  160.         done
  161.  
  162. # Build the toplevel Makefile
  163. Makefile:    Makefile.in config.status
  164.         CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) config.status
  165.  
  166. # Run the configure script.  If config.status already exists,
  167. # call it with the --recheck argument, which reruns configure with the
  168. # same options as it was run last time; otherwise run the configure
  169. # script with options taken from the $(WITH) variable
  170. config.status:    $(srcdir)/configure
  171.         if test -f config.status; \
  172.         then $(SHELL) config.status --recheck; \
  173.         else $(SHELL) $(srcdir)/configure $(WITH); \
  174.         fi
  175.  
  176. .PRECIOUS:    config.status python
  177.  
  178. # Rerun configure with the same options as it was run last time,
  179. # provided the config.status script exists
  180. recheck:
  181.         $(SHELL) config.status --recheck
  182.  
  183. # Rebuild the configure script from configure.in; also rebuild config.h.in
  184. autoconf:
  185.         (cd $(srcdir); autoconf; autoheader)
  186.  
  187. # Create a tags file for vi
  188. tags::
  189.         ctags -w -t Include/*.h
  190.         for i in $(SUBDIRS); do ctags -w -t -a $$i/*.[ch]; done
  191.         sort tags -o tags
  192.  
  193. # Create a tags file for GNU Emacs
  194. TAGS::
  195.         etags Include/*.h
  196.         for i in $(SUBDIRS); do etags -a $$i/*.[ch]; done
  197.  
  198. # Add dependencies to sub-Makefiles
  199. depend:
  200.         for i in $(SUBDIRS); do \
  201.             (echo $$i; cd $$i; $(MAKE) depend); \
  202.         done
  203.  
  204. # Sanitation targets -- clean leaves libraries, executables and tags
  205. # files, which clobber removes those as well
  206.  
  207. localclean:
  208.         -rm -f core *~ [@,#]* *.old *.orig *.rej
  209.  
  210. clean:        localclean
  211.         -for i in $(SUBDIRS); do \
  212.             (echo $$i; cd $$i; \
  213.              if test -f Makefile; \
  214.              then $(MAKE) clean; \
  215.              else $(MAKE) -f Makefile.*in clean; \
  216.              fi); \
  217.         done
  218.  
  219. localclobber:    localclean
  220.         -rm -f tags TAGS python
  221.  
  222. clobber:    localclobber
  223.         -for i in $(SUBDIRS); do \
  224.             (echo $$i; cd $$i; \
  225.              if test -f Makefile; \
  226.              then $(MAKE) clobber; \
  227.              else $(MAKE) -f Makefile.in clobber; \
  228.              fi); \
  229.         done
  230.  
  231. # Make things extra clean, before making a distribution
  232. distclean:    clobber
  233.         -$(MAKE) SUBDIRS="$(SUBDIRSTOO)" clobber
  234.         -rm -f config.status config.h Makefile
  235.         -for i in $(SUBDIRS) $(SUBDIRSTOO); do \
  236.              for f in $$i/*.in; do \
  237.                 f=`basename "$$f" .in`; \
  238.                  if test "$$f" != "*"; then \
  239.                     echo rm -f "$$i/$$f"; \
  240.                      rm -f "$$i/$$f"; \
  241.                 fi; \
  242.              done; \
  243.         done
  244.  
  245. # Find files with funny names
  246. find:
  247.         find $(DISTDIRS) -type d \
  248.             -o -name '*.[chs]' \
  249.             -o -name '*.py' \
  250.             -o -name '*.doc' \
  251.             -o -name '*.sty' \
  252.             -o -name '*.bib' \
  253.             -o -name '*.dat' \
  254.             -o -name '*.el' \
  255.             -o -name '*.fd' \
  256.             -o -name '*.in' \
  257.             -o -name '*.tex' \
  258.             -o -name '*,[vpt]' \
  259.             -o -name 'Setup' \
  260.             -o -name 'Setup.*' \
  261.             -o -name README \
  262.             -o -name Makefile \
  263.             -o -name ChangeLog \
  264.             -o -name RCS \
  265.             -o -name Repository \
  266.             -o -name Entries \
  267.             -o -name Tag \
  268.             -o -name tags \
  269.             -o -name TAGS \
  270.             -o -name .cvsignore \
  271.             -o -name MANIFEST \
  272.             -o -print
  273.  
  274. # Build a distribution tar file (run make distclean first)
  275. # (This leaves the RCS and CVS directories in :-( )
  276. tar:
  277.         tar cf - $(DIST) | gzip --best >dist.tar.gz
  278.